package top.porchwood.util.common;

import org.springframework.lang.NonNull;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @Author 一七年夏
 * @Link https://space.bilibili.com/16869954
 * @Email 2098833867@qq.com
 * @License GNU General Public Liscene 3.0
 * @DateTime 2021-07-30 0:45
 */
public class ObjectConver {
    public static String exceptionToStackTraceString(@NonNull Exception e) {
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw);
        e.printStackTrace(pw);
        pw.close();
        return sw.toString();
    }
}
